﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Thông tin
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Partner obj = (Partner)ViewData.Model;
       List<sp_GetPartnerAddressListResult> listAddress = (List<sp_GetPartnerAddressListResult>)ViewData["PartnerAddesssList"];
       sp_GetMainPartnerAddressResult objMainAddress = (sp_GetMainPartnerAddressResult)ViewData["MainPartnerAddesss"]; %>
    <%= Html.Hidden("URLBack", (string)ViewData["LinkBack"])%>
    <div class="ccat">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td class="ccat-lft">
                    <div class="cat-header">
                        <span>Danh mục</span>
                    </div>
                    <% Html.RenderPartial("Modules/Mod_SubMenu"); %>
                    <% Html.RenderPartial("Modules/Mod_AdvertisingLeft"); %>
                </td>
                <td class="ccat-rgh">
                    <div class="ccat-breadcrumb">
                        <%= (string)ViewData["NavigationLink"]%>
                    </div>
                    <div class="detail-partner">
                        <div class="box">
                            <div class="pd-icon-top">
                            </div>
                            <div class="pname">
                                <%= obj.PartnerName %></div>
                            <div>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td class="plogo" style="width: 25%">
                                            <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + obj.Logo%>" width="132" height="120" />
                                        </td>
                                        <td>
                                            <div class="minfo">
                                                <p>
                                                    <span>Tình trạng:</span><span class="info"><%= HttpUtility.HtmlEncode(obj.Status) %></span></p>
                                                <% if (obj.OldPrice != null)
                                                   { %>
                                                <p>
                                                    <span>Giá cũ:</span><span class="info"><s><%= String.Format("{0:0,0} đ", obj.OldPrice)%></s></span></p>
                                                <%} %>
                                                <p>
                                                    <span style="color: Red">Giá:</span><span class="info" style="color: Red"><%= (obj.CurrentPrice == null ? "Call" : String.Format("{0:0,0} đ", obj.CurrentPrice))%></span></p>
                                                <% if (!string.IsNullOrEmpty(obj.DiscountInfo))
                                                   { %>
                                                <p>
                                                    <span>Tiết kiệm:</span><b class="pdown"><%= HttpUtility.HtmlEncode(obj.DiscountInfo) %></b></p>
                                                <%} %>
                                                <p>
                                                    <span>Hàng trong kho:</span> <b>
                                                        <% if (obj.IsAvailable) Response.Write("Đang có sẵn"); else Response.Write("Không có sẵn"); %>
                                                    </b>
                                                </p>
                                                <p>
                                                    <span>Thời gian nhận:</span><span class="info"><%= HttpUtility.HtmlEncode(obj.ReceivedTime) %></span></p>
                                                <p>
                                                    <span>Lượt xem:</span><%= HttpUtility.HtmlEncode(obj.View)%></p>
                                                <p>
                                                    <span>Xuất xứ:</span><%= HttpUtility.HtmlEncode(obj.Manufacturer)%></p>
                                                    <p>
                                                    <span>Mã sản phẩm:</span><%= HttpUtility.HtmlEncode(obj.ID)%></p>
                                                <% List<Promotion> listPromotion = (List<Promotion>)ViewData["PartnerPromotion"];
                                                   if (listPromotion.Count > 0)
                                                   {%>
                                                <p>
                                                    <a href="#tips" class="promotion">+ Xem thông tin bảo hành</a>
                                                </p>
                                                <%} %>
                                                <p>
                                                    <a href="<%=FRouter._("dathang",obj.ID.ToString(),obj.PartnerName) %>">
                                                        <img src="../../Content/Images/muahang.jpg" /></a></p>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="clrfix">
                            </div>
                        </div>
                        
                        <%if (!string.IsNullOrEmpty(obj.Description))
                          { %>
                        <div class="box">
                            <div class="ptitle">
                                Giới thiệu
                            </div>
                            <div class="pcontent">
                                <p>
                                    <%=obj.Description%></p>
                            </div>
                        </div>
                        <% } %>
                        <% List<Gallery> listGallery = (List<Gallery>)ViewData["PartnerGallery"];
                           if (listGallery.Count > 0)
                           {
                        %>
                        <div class="box">
                            <div class="ptitle">
                                Hình ảnh
                            </div>
                            <ul class="pcontent" id="myGallery">
                                <% foreach (Gallery gallery in listGallery)
                                   {%>
                                <li>
                                    <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + gallery.Image%>" width="400" title="" /></li>
                                <%} %>
                            </ul>
                        </div>
                        <% } %>
                        <% if (listPromotion.Count > 0)
                           { %>
                        <div class="box">
                            <div class="ptitle">
                                Bảo hành
                            </div>
                            <div class="pcontent">
                                <% int promotionIndex = 1;
                                   foreach (Promotion promotion in listPromotion)
                                   {%>
                                <table border="0" id="tips" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <p>
                                                <%=promotion.PromotionInfo%></p>
                                        </td>
                                    </tr>
                                </table>
                                <% promotionIndex++;
                                   }
                                %>
                            </div>
                        </div>
                        <% } %>
                        </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/jquery-timers.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-easing.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-galleryview3.0.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
    <link href="../../Scripts/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
    <script type="text/javascript">
        function filter() {
            JS_LIB.setFilter($("#txtKeyWord").val(), $("#ProvinceList").val(), $("#DistrictList").val(), $("#URLBack").val());
        }
        $(document).ready(function () {
            $('#myGallery').galleryView({
                panel_width: 400,
                panel_height: 350,
                frame_width: 60,
                frame_height: 40,
                show_fancybox: 'fancy'
            });
            $("a.fancy").fancybox();
            $('#myGallery :first').css("display", "block");
            $("#ProvinceList").change(function () {
                var provinceID = $("#ProvinceList").val();
                $("#DistrictList").html("");
                $("#DistrictList").append($("<option value=''><%= Constants.CATEGORY_FIRST_DISTRICT %></option>"));
                if (provinceID != 0) {
                    $.getJSON('/Library/GenericHandle/DropdownListHandler.ashx?ID=' + provinceID + '&Page=District', function (item) {
                        $.each(item, function () {
                            $("#DistrictList").append($("<option value='" + this['ID'] + "'>" + this['Name'] + "</option>"));
                        });
                    });
                }
            });
            $("a.promotion").click(function () {
            });

        });
    </script>
</asp:Content>
